<ion-view view-title="产品详情" cache-view="false">
    <ion-nav-buttons side="left">
        <back-button></back-button>
    </ion-nav-buttons>
    <ion-content ng-class="{'has-loading': isOffline}">

        <ion-refresher pulling-text={{PULLING_TEXT}} pulling-icon="" refreshing-text={{REFRESHING_TEXT}}
                       on-refresh="doRefresh()"></ion-refresher>

        <!-- unlimited -->
        <div class="unlimited unlimited-item" ng-show="!param.duration_detail">
            <!-- item -->
            <div class="on">
                <div class="hd">
                    <concern></concern>
                    <h2 class="prodName">{{fund.prod_name | defString }}<em>{{fund.prod_code | defString }}</em></h2>
                </div>
                <!-- income items -->
                <ul class="income-items clearfix">
                    <li ng-if="fund.prod_profit_mode== 0">
                        七日年化收益率<em class="{{fund.prod_yield>=0 ? 'inc' : 'inc_'}}">{{fund.prod_yield | defNumber:4}}<sub>%</sub></em>
                    </li>
                    <li ng-if="fund.prod_profit_mode== 2">
                        预期年化收益率<em class="{{fund.prod_profit_rate>=0 ? 'inc' : 'inc_'}}">{{fund.prod_profit_rate | number:2}}<sub>%</sub></em>
                    </li>
                    <li ng-if="fund.prod_profit_mode== 3 && 'fdxqszg'==fund.prod_catalog_mark">
                        近一年涨幅<em class="{{fund.price_increase_year>=0 ? 'inc' : 'inc_'}}">{{fund.price_increase_year | number:2}}<sub>%</sub></em>
                    </li>
                    <li ng-if="fund.prod_profit_mode== 3 && 'fdxqszg'!=fund.prod_catalog_mark">
                        预期年化收益率<em class="{{fund.prod_profit_rate>=0 ? 'inc' : 'inc_'}}">{{fund.prod_profit_rate | number:2}}<sub>%</sub></em>
                    </li>

                    <li ng-if="fund.prod_profit_mode== 0">
                        万份收益<em>{{fund.prod_gain | defNumber:4}}<sub>元</sub></em>
                    </li>
                    <li ng-if="fund.prod_profit_mode== 3">
                        最新价(单位净值)<em>{{fund.prod_nav | defNumber:4}}<sub>元</sub></em>
                    </li>

                    <li ng-if="fund.prod_profit_mode== 0 || fund.prod_profit_mode== 3">
                        产品规模<em>{{fund.prod_scale | defNumber:2}}<sub>亿</sub></em>
                    </li>

                    <li>起购金额<em ng-bind-html="fund.prodMinSubscribe_show"></em></li>
                </ul>
                <time ng-if="fund.prod_status!=4 && param.show_chart">
                    <span ng-if="fund.prod_profit_mode!=2 && 3!=fund.prod_profit_mode">七日年化收益率走势更新日期：</span>
                    <span ng-if="fund.prod_profit_mode==2 || 3==fund.prod_profit_mode">数据更新日期：</span>
                    <span>{{param.lastTime | date:'yyyyMMdd'}}</span>
                </time>
                <!-- chart -->
                <div class="chart" ng-if="fund.prod_status!=4&&param.show_chart">
                    <!--<div class="mask"></div>-->
                    <highchart config="param.chartConfig"></highchart>
                </div>
            </div>
        </div>
        <!-- panel -->
        <div class="panel" ng-show="!param.duration_detail">
            <div class="item">
                <span class="title">产品类型</span>
                <span class="rtl">{{fund.prod_catalog_name | defString}}</span>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}" ng-if="fund.prod_profit_mode== 2||(fund.prod_profit_mode== 3&&'fdxqszg'==fund.prod_catalog_mark)||(fund.prod_status!=4&&fund.prod_status!=5)">
                <a ng-click="showProdDurationDetail()"><span class="title">期限</span>
                    <span class="rtl">{{fund.prod_duration | defNumber : null :'天'}}</span></a>
            </div>
            <div class="item"  ng-if="fund.prod_profit_mode== 2">
                <span class="title">募集开始日期</span>
                <span class="rtl">{{fund.ipo_begin_date | defDateString}}</span>
            </div>
            <div class="item"  ng-if="fund.prod_profit_mode== 2">
                <span class="title">募集结束日期</span>
                <span class="rtl">{{fund.ipo_end_date | defDateString}}</span>
            </div>
            <div class="item"  ng-if="fund.prod_profit_mode== 2">
                <span class="title">起息日</span>
                <span class="rtl">{{fund.prod_setup_date | defDateString}}</span>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}" ng-if="fund.prod_status==4&&fund.prod_profit_mode!= 2&&!(fund.prod_profit_mode== 3&&'fdxqszg'==fund.prod_catalog_mark)">
                <a ng-click="showProdDurationDetail()">
                    <span class="title">认购期</span>
                    <span class="rtl">{{fund.prod_attr_ext_info.prod_persub_desc}}</span>
                </a>
            </div>
            <div class="item" ng-class="{grp : fund.prod_duration_desc}"  ng-if="fund.prod_status==5&&fund.prod_profit_mode!= 2&&!(fund.prod_profit_mode== 3&&'fdxqszg'==fund.prod_catalog_mark)">
                <a ng-click="showProdDurationDetail()">
                    <span class="title">封闭期</span>
                    <span class="rtl">{{fund.prod_attr_ext_info.prod_close_desc}}</span>
                </a>
            </div>
            <div class="item">
                <span class="title">风险等级</span>
                <span class="rtl">{{fund.prod_risk_level | dictionary : 'prodRisks'}}</span>
            </div>
           <!-- <div class="item group" ng-if="fund.is_entrust=='0'">
                <a ng-href="#/tab/product-rate/{{fund.prod_id}}">费率</a>
            </div>-->
            <div class="item" ng-show="fund.prod_grade_level">
                <span class="title">基金评级&nbsp;&nbsp;
                    <!--<a class="icon_help" ng-href="#/help-item/1839">?</a>-->
                </span>
                <span class="rtl"><em class="grade {{'g' + fund.prod_grade_level}}"></em></span>
            </div>
            <div class="item group">
                <a href="#/tab/product-detail/{{fund.prod_code}}">了解更多产品详情</a>
            </div>
        </div>
        <div class="little-tip" ng-show="!param.duration_detail">基金有风险，投资需谨慎！购买前需仔细阅读基金合同和招募说明书等法律文件。</div>
        </div>
        <!-- panel -->
        <div class="panel grpDetail word-wrap" style="padding-top: 15px" ng-show="param.duration_detail" ng-bind-html="fund.prod_duration_desc"></div>
    </ion-content>

    <ion-footer-bar class="footer" ng-show="!param.duration_detail">
        <dl>
            <!--<dt ng-if="fund.is_entrust=='1'">费率：<em>{{fund.prod_rate | defNumber: 2}}</em>% </dt>-->
            <dt><a ng-href="#/tab/product-rate/{{fund.prod_id}}">费率：<em id="prodCharge">{{fund.prod_rate | defNumber: 2}}</em>% </a></dt>
            <dd>
                <a ng-if="fund.prod_status== 0 || fund.prod_status == 3 || fund.prod_status == 4" class="btn"
                   buy-button prod_code="{{fund.prod_code}}" prod_source="{{fund.prod_source}}">购买</a>
                <a ng-if="fund.prod_status== 2" class="btn disable">暂停申购</a>
                <a ng-if="fund.prod_status== 5" class="btn disable">封闭期</a>
                <a ng-if="fund.prod_status== 1" class="btn disable">暂停交易</a>
            </dd>
        </dl>
    </ion-footer-bar>
</ion-view>
